package com.third.bank.exception;

import com.third.bank.util.ErrorMessage;

/**
 * 自定义的异常类
 */
public class BusinessException extends RuntimeException{

    private final int code;

    public BusinessException(int code , String message){
        super(message);
        this.code = code;
    }

    public BusinessException(ErrorMessage message){
        super(message.getMessage());
        this.code = message.getCode();
    }

    public int getCode(){
        return code;
    }
}
